package com.edu.employee.controller.test;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @ProjectName: summer-project
 * @Titile: UserController
 * @Author: Lucky
 * @Description: TODO
 */
@RestController
@RequestMapping("/api/user")
@Slf4j
public class UserController {
    @PostMapping("login")
    public String login(){
        log.info("正在登录...");
        return "login...";
    }
    @GetMapping("main")
    public String home(HttpServletRequest request){
        //获取请求头
        String token = request.getHeader("Authorization");
        log.info("获取到的用户身份:{}",token);
        return "首页";
    }
}
